import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import fire_component_msg from '@feidao/web/atom/browser/fsm/fire-component-msg';

export default async function a003(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	// 非公共课分配考场
	const boxs = fd.data.node.querySelectorAll('[data-feidao-name="subjects"]:checked');
	if (boxs.length === 0) {
		alert('请选择考试科目');
		return;
	} else if (boxs.length > 1) {
		alert('只能选择一个考试科目');
		return;
	} else {
		const id = boxs[0].getAttribute('data-feidao-id');
		const p = boxs[0].getAttribute('data-feidao-p');
		fire_component_msg('zj-exam-arrange-002', 'ec-001', id, parseInt(p));
	}
}
